﻿
using EventBus.Common;
using System;
namespace EventBus.RabbitMQ
{
    public interface IRabbitMqSubscriber
    {
        /// <summary>
        /// 订阅rCommand
        /// </summary>
        /// <typeparam name="TCommand"></typeparam>
        /// <param name="serviceProvider"></param>
        /// <param name="queueName"></param>
        /// <param name="deadLetter"></param>
        void SubscriberCommand<TCommand>(IServiceProvider serviceProvider, string queueName, bool deadLetter = false) where TCommand : ICommand;

        /// <summary>
        /// 订阅Event
        /// </summary>
        /// <typeparam name="TEvent"></typeparam>
        /// <param name="serviceProvider"></param>
        /// <param name="queueName"></param>
        /// <param name="deadLetter"></param>
        void SubscriberEvent<TEvent>(IServiceProvider serviceProvider, string queueName, bool deadLetter = false) where TEvent : IEvent;
    }
}

